<!DOCTYPE html>
<html lang="en-US" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>本地开发 | Sakura</title>
    <meta name="description" content="Intuitive, type safe, light and flexible Store for Vue">
    <meta name="generator" content="VitePress v1.6.3">
    <link rel="preload stylesheet" href="/assets/style.BfYLPI5H.css" as="style">
    <link rel="preload stylesheet" href="/vp-icons.css" as="style">
    <script type="module" src="/assets/chunks/metadata.550c04ff.js"></script>
    <script type="module" src="/assets/app.Cg95mKDs.js"></script>
    <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/assets/chunks/theme.BLgPf3G8.js">
    <link rel="modulepreload" href="/assets/chunks/framework.DmV6WhQo.js">
    <link rel="modulepreload" href="/assets/src_en_1.使用指南_3.本地开发_index.md.DkVpdF0f.lean.js">
    <link rel="icon" type="image/svg+xml" href="/logo.svg">
    <link rel="icon" type="image/png" href="/logo.png">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css">
    <script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js"></script>
    <meta name="wwads-cn-verify" content="5878a7ab84fb43402106c575658472fa">
    <meta property="og:type" content="website">
    <meta property="twitter:card" content="summary_large_image">
    <meta property="twitter:image" content="https://pinia.vuejs.org/social.png">
    <script src="https://cdn.usefathom.com/script.js" data-site="KFPPRRIS" data-spa="auto" defer></script>
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"dark",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
    <meta property="og:url" content="https://pinia.vuejs.org">
    <meta property="og:description" content="Intuitive, type safe, light and flexible Store for Vue">
    <meta property="twitter:url" content="https://pinia.vuejs.org">
    <meta property="twitter:title" content="Pinia 🍍">
    <meta property="twitter:description" content="Intuitive, type safe, light and flexible Store for Vue">
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-f4468d7a><!--[--><!--]--><!--[--><span tabindex="-1" data-v-e447c754></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-e447c754>Skip to content</a><!--]--><!----><header class="VPNav" data-v-f4468d7a data-v-cc9dd77b><div class="VPNavBar" data-v-cc9dd77b data-v-98ffb67c><div class="wrapper" data-v-98ffb67c><div class="container" data-v-98ffb67c><div class="title" data-v-98ffb67c><div class="VPNavBarTitle has-sidebar" data-v-98ffb67c data-v-4b503d9c><a class="title" href="/" data-v-4b503d9c><!--[--><!--]--><!--[--><img class="VPImage logo" src="/logo.svg" alt data-v-f4527aeb><!--]--><span data-v-4b503d9c>Sakura</span><!--[--><!--]--></a></div></div><div class="content" data-v-98ffb67c><div class="content-body" data-v-98ffb67c><!--[--><!--]--><div class="VPNavBarSearch search" data-v-98ffb67c><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-98ffb67c data-v-ff561a0c><span id="main-nav-aria-label" class="visually-hidden" data-v-ff561a0c> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/1.%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/1.%E4%BA%A7%E5%93%81%E7%AE%80%E4%BB%8B/index" tabindex="0" data-v-ff561a0c data-v-562e3cbe><!--[--><span data-v-562e3cbe>Guide</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/2.使用手册/0.流程图/index.html" tabindex="0" data-v-ff561a0c data-v-562e3cbe><!--[--><span data-v-562e3cbe>Manual</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/3.其它/1.常见问题/index.html" tabindex="0" data-v-ff561a0c data-v-562e3cbe><!--[--><span data-v-562e3cbe>Q&A</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/3.其它/3.赞助支持/index.html" tabindex="0" data-v-ff561a0c data-v-562e3cbe><!--[--><span data-v-562e3cbe>Sponsor💖</span><!--]--></a><!--]--><!--[--><a class="VPLink link vp-external-link-icon VPNavBarMenuLink" href="https://www.sakura.hk.cn:28383" target="_blank" rel="noreferrer" tabindex="0" data-v-ff561a0c data-v-562e3cbe><!--[--><span data-v-562e3cbe>Experience</span><!--]--></a><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-98ffb67c data-v-7787f7b2 data-v-c07e882e><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-c07e882e><span class="text" data-v-c07e882e><span class="vpi-languages option-icon" data-v-c07e882e></span><!----><span class="vpi-chevron-down text-icon" data-v-c07e882e></span></span></button><div class="menu" data-v-c07e882e><div class="VPMenu" data-v-c07e882e data-v-3d7ad723><!----><!--[--><!--[--><div class="items" data-v-7787f7b2><p class="title" data-v-7787f7b2>English</p><!--[--><div class="VPMenuLink" data-v-7787f7b2 data-v-f7d422d7><a class="VPLink link" href="/src/zh/src/en/1.使用指南/3.本地开发/" data-v-f7d422d7><!--[--><span data-v-f7d422d7>简体中文</span><!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-98ffb67c data-v-3e6de47a><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="true" data-v-3e6de47a data-v-4698b85c data-v-3726b66d><span class="check" data-v-3726b66d><span class="icon" data-v-3726b66d><!--[--><span class="vpi-sun sun" data-v-4698b85c></span><span class="vpi-moon moon" data-v-4698b85c></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-98ffb67c data-v-3e576fcb data-v-42baa202><!--[--><a class="VPSocialLink no-icon" href="https://github.com/SakuraTechy/Sakura.Automation.Platform.Api" aria-label="github" target="_blank" rel="noopener" data-v-42baa202 data-v-27dc7f6e><span class="vpi-social-github"></span></a><a class="VPSocialLink no-icon" href="https://gitee.com/SakuraTech/Sakura.Automation.Platform.Api" aria-label target="_blank" rel="noopener" data-v-42baa202 data-v-27dc7f6e><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>码云</title><path d="M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"/></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-98ffb67c data-v-6e90f605 data-v-c07e882e><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-c07e882e><span class="vpi-more-horizontal icon" data-v-c07e882e></span></button><div class="menu" data-v-c07e882e><div class="VPMenu" data-v-c07e882e data-v-3d7ad723><!----><!--[--><!--[--><div class="group translations" data-v-6e90f605><p class="trans-title" data-v-6e90f605>English</p><!--[--><div class="VPMenuLink" data-v-6e90f605 data-v-f7d422d7><a class="VPLink link" href="/src/zh/src/en/1.使用指南/3.本地开发/" data-v-f7d422d7><!--[--><span data-v-f7d422d7>简体中文</span><!--]--></a></div><!--]--></div><div class="group" data-v-6e90f605><div class="item appearance" data-v-6e90f605><p class="label" data-v-6e90f605>Appearance</p><div class="appearance-action" data-v-6e90f605><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="true" data-v-6e90f605 data-v-4698b85c data-v-3726b66d><span class="check" data-v-3726b66d><span class="icon" data-v-3726b66d><!--[--><span class="vpi-sun sun" data-v-4698b85c></span><span class="vpi-moon moon" data-v-4698b85c></span><!--]--></span></span></button></div></div></div><div class="group" data-v-6e90f605><div class="item social-links" data-v-6e90f605><div class="VPSocialLinks social-links-list" data-v-6e90f605 data-v-42baa202><!--[--><a class="VPSocialLink no-icon" href="https://github.com/SakuraTechy/Sakura.Automation.Platform.Api" aria-label="github" target="_blank" rel="noopener" data-v-42baa202 data-v-27dc7f6e><span class="vpi-social-github"></span></a><a class="VPSocialLink no-icon" href="https://gitee.com/SakuraTech/Sakura.Automation.Platform.Api" aria-label target="_blank" rel="noopener" data-v-42baa202 data-v-27dc7f6e><svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>码云</title><path d="M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"/></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-98ffb67c data-v-e8104da4><span class="container" data-v-e8104da4><span class="top" data-v-e8104da4></span><span class="middle" data-v-e8104da4></span><span class="bottom" data-v-e8104da4></span></span></button></div></div></div></div><div class="divider" data-v-98ffb67c><div class="divider-line" data-v-98ffb67c></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-f4468d7a data-v-f414f456><div class="container" data-v-f414f456><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-f414f456><span class="vpi-align-left menu-icon" data-v-f414f456></span><span class="menu-text" data-v-f414f456>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-f414f456 data-v-410b07a5><button data-v-410b07a5>返回顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-f4468d7a data-v-d9d2e79b><div class="curtain" data-v-d9d2e79b></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-d9d2e79b><span class="visually-hidden" id="sidebar-aria-label" data-v-d9d2e79b> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-0f5b6f63><section class="VPSidebarItem level-0 collapsible" data-v-0f5b6f63 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h2 class="text" data-v-77ed1583>使用指南</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/1.使用指南/1.产品简介/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>产品简介</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/1.使用指南/2.快速开始/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>快速开始</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/1.使用指南/3.本地开发/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>本地开发</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/1.使用指南/4.项目结构/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>项目结构</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-0f5b6f63><section class="VPSidebarItem level-0 collapsible" data-v-0f5b6f63 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h2 class="text" data-v-77ed1583>使用手册</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/0.流程图/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>流程图</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/1.注册登录/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>注册登录</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible" data-v-77ed1583 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h3 class="text" data-v-77ed1583>项目管理</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/2.项目管理/1.项目配置/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>项目配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/2.项目管理/2.环境配置/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>环境配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/2.项目管理/3.自动化配置/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>自动化配置</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible" data-v-77ed1583 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h3 class="text" data-v-77ed1583>测试管理</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/3.测试管理/1.测试场景/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>测试场景</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/3.测试管理/2.测试计划/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>测试计划</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/3.测试管理/3.测试报告/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>测试报告</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/3.测试管理/4.定时任务/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>定时任务</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/3.测试管理/5.测试度量/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>测试度量</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible" data-v-77ed1583 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h3 class="text" data-v-77ed1583>接口管理</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/4.接口管理/1.接口测试/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>接口测试</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible" data-v-77ed1583 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h3 class="text" data-v-77ed1583>自动化管理</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-2 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/2.使用手册/5.自动化管理/1.UI自动化/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>UI自动化</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-0f5b6f63><section class="VPSidebarItem level-0 collapsible" data-v-0f5b6f63 data-v-77ed1583><div class="item" role="button" tabindex="0" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><h2 class="text" data-v-77ed1583>其它</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-77ed1583><span class="vpi-chevron-right caret-icon" data-v-77ed1583></span></div></div><div class="items" data-v-77ed1583><!--[--><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/3.其它/1.常见问题/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>常见问题</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/3.其它/2.问卷调查/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>问卷调查</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-77ed1583 data-v-77ed1583><div class="item" data-v-77ed1583><div class="indicator" data-v-77ed1583></div><a class="VPLink link link" href="/3.其它/3.赞助支持/index.html" data-v-77ed1583><!--[--><p class="text" data-v-77ed1583>赞助支持 💖</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-f4468d7a data-v-d45605be><div class="VPDoc has-sidebar has-aside" data-v-d45605be data-v-33eb8004><!--[--><!--]--><div class="container" data-v-33eb8004><div class="aside" data-v-33eb8004><div class="aside-curtain" data-v-33eb8004></div><div class="aside-container" data-v-33eb8004><div class="aside-content" data-v-33eb8004><div class="VPDocAside" data-v-33eb8004 data-v-9d4c520d><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-9d4c520d data-v-ce6f73d4><div class="content" data-v-ce6f73d4><div class="outline-marker" data-v-ce6f73d4></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-ce6f73d4>On This Page</div><ul class="VPDocOutlineItem root" data-v-ce6f73d4 data-v-69b40bfa><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-9d4c520d></div><!--[--><!--]--><div class="VPDocAsideCarbonAds" data-v-9d4c520d><div class="VPCarbonAds" data-v-35185ad4></div></div><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-33eb8004><div class="content-container" data-v-33eb8004><!--[--><!--]--><main class="main" data-v-33eb8004><div style="position:relative;" class="vp-doc _src_en_1_%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97_3_%E6%9C%AC%E5%9C%B0%E5%BC%80%E5%8F%91_" data-v-33eb8004><div><h1 id="本地开发" tabindex="-1">本地开发 <a class="header-anchor" href="#本地开发" aria-label="Permalink to &quot;本地开发&quot;">​</a></h1><h2 id="环境搭建" tabindex="-1">环境搭建 <a class="header-anchor" href="#环境搭建" aria-label="Permalink to &quot;环境搭建&quot;">​</a></h2><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下载地址：<a href="https://share.weiyun.com/lFNsB9Ye" target="_blank" rel="noreferrer">https://share.weiyun.com/lFNsB9Ye</a></p></div><ul><li>JDK = v1.8 (推荐v1.8版本)</li><li>Ant &gt;= v1.9.6 (推荐v1.9.6版本)</li><li>Redis &gt;= v7.0.5(推荐v7.0.5版本)</li><li>Maven &gt;= v3.3.9(推荐v3.3.9版本)</li><li>Mysql &gt;= v5.7.0 (推荐v5.7.0版本)</li><li>Git &gt;= v2.36.1 (推荐v2.36.1版本)</li><li>Python = v3.9.0 (推荐v3.9.0版本)</li><li>Node &gt;= v16.16.0 (推荐v16.16.0版本)</li><li>Eclipse/IDEA (推荐IDEA稳定版本)</li><li>Microsoft VS Code (推荐VS Code稳定版本)</li><li>Navicat (推荐稳定版本)</li></ul><h2 id="项目启动" tabindex="-1">项目启动 <a class="header-anchor" href="#项目启动" aria-label="Permalink to &quot;项目启动&quot;">​</a></h2><h3 id="后端启动" tabindex="-1">后端启动 <a class="header-anchor" href="#后端启动" aria-label="Permalink to &quot;后端启动&quot;">​</a></h3><ul><li><p>创建本地目录，例如：<code>D:\IDEA\Sakura.Automation.Platform</code></p></li><li><p>进入项目目录，执行命令：</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">cd</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> D:</span><span style="--shiki-dark:#F286C4;--shiki-light:#A65E2B;">\I</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;">DEA</span><span style="--shiki-dark:#F286C4;--shiki-light:#A65E2B;">\S</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;">akura.Automation.Platform</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">git</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> clone</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> https://github.com/hagyao520/Sakura.Automation.Platform.Api.git</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">或</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">git</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> clone</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> https://gitee.com/SakuraTech/Sakura.Automation.Platform.Api.git</span></span></code></pre></div></li><li><p>启动Eclipse或IDEA，导入或打开项目Sakura.Automation.Platform.Api</p></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>使用Eclipse，菜单 File -&gt; Import，然后选择 Maven -&gt; Existing Maven Projects，点击 Next&gt; 按钮，选择工作目录，然后点击 Finish 按钮，即可成功导入。</li><li>使用IDEA，菜单 File -&gt; Open，选择工作目录，然后点击 OK 按钮，即可成功导入。</li><li>初次会自动加载Maven依赖包，加载会比较慢（根据自身网络情况而定）</li></ul></div><p><img src="/assets/image.D69dlqkV.png" alt="alt text" data-fancybox="gallery"></p><ul><li>创建MySQL数据库，执行初始化SQL脚本</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><ol><li>默认已经安装好1Panel面板并创建好MySQL数据库，可直接使用，详情请进入1Panel数据库管理面板查看</li></ol><ul><li>地址：<a href="http://172.19.5.227:28134/c0464ecc59" target="_blank" rel="noreferrer">http://172.19.5.227:28134/c0464ecc59</a> （地址中的IP请改为你的服务器IP）</li><li>账号：root</li><li>密码：3edc%RFV</li><li>路径：打开左侧数据库菜单，选择顶部MySQL选项</li></ul><ol start="2"><li>默认有2个数据库，开发测试共用一个，生产单独用一个</li></ol><blockquote><p>开发&amp;测试数据库</p></blockquote><ul><li>数据库名：sakura_dev</li><li>端口：3306</li><li>账号：sakura_dev</li><li>密码：3edc%RFV</li></ul><blockquote><p>生产数据库</p></blockquote><ul><li>数据库名：sakura</li><li>端口：3306</li><li>账号：sakura</li><li>密码：3edc%RFV</li></ul></div><p><img src="/assets/image-1.xGbycF-7.png" alt="alt text" data-fancybox="gallery"></p><ul><li>修改<code>sakura-admin/src/main/resources/application-dev.yml</code>中master下url中的IP，其他默认即可</li></ul><div class="language-yml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yml</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;"># 数据源配置</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">spring</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">  datasource</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    type</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> com.alibaba.druid.pool.DruidDataSource</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    driverClassName</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> com.mysql.cj.jdbc.Driver</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    druid</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 主库数据源</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      master</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        url</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> jdbc:mysql://172.19.5.227:3306/sakura_dev?useUnicode=true&amp;characterEncoding=utf8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=true&amp;serverTimezone=GMT%2B8&amp;&amp;allowMultiQueries=true</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        username</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> sakura_dev</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        password</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> 3edc%RFV</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 从库数据源</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      slave</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # 从数据源开关/默认关闭</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        enabled</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> false</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        url</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        username</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        password</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 初始连接数</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      initialSize</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 5</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 最小连接池数量</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      minIdle</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 10</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 最大连接池数量</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      maxActive</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 20</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 配置获取连接等待超时的时间</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      maxWait</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 60000</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 配置间隔多久才进行一次检测，检测需要关闭的空闲连接，单位是毫秒</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      timeBetweenEvictionRunsMillis</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 60000</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 配置一个连接在池中最小生存的时间，单位是毫秒</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      minEvictableIdleTimeMillis</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 300000</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 配置一个连接在池中最大生存的时间，单位是毫秒</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      maxEvictableIdleTimeMillis</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 900000</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # 配置检测连接是否有效</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      validationQuery</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> SELECT 1 FROM DUAL</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      testWhileIdle</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      testOnBorrow</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> false</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      testOnReturn</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> false</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      webStatFilter</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        enabled</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      statViewServlet</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        enabled</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # 设置白名单，不填则允许所有访问</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        allow</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        url-pattern</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> /druid/*</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # 控制台管理用户名和密码</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        login-username</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> sakura</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        login-password</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 123456</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      filter</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        stat</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">          enabled</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">          # 慢SQL记录</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">          log-slow-sql</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">          slow-sql-millis</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 1000</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">          merge-sql</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        wall</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">          config</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">            multi-statement-allow</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#1E754F;"> true</span></span></code></pre></div><p><img src="/assets/image-2.CL1DnSqq.png" alt="alt text" data-fancybox="gallery"></p><ul><li>创建Redis数据库</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><ol><li>1Panel面板默认已经安装并创建好Redis数据库，可直接使用，详情请进入1Panel数据库管理面板查看</li></ol><ul><li>地址：<a href="http://172.19.5.227:28134/c0464ecc59" target="_blank" rel="noreferrer">http://172.19.5.227:28134/c0464ecc59</a> （地址中的IP请改为你的服务器IP）</li><li>账号：root</li><li>密码：3edc%RFV</li><li>路径：打开左侧数据库菜单，选择顶部Redis选项</li></ul><ol start="2"><li>默认端口为6379，如果需要同时使用多个Redis时，建议创建多个Docker容器配置不同的端口启动</li></ol><ul><li>进入1Panel面板，点击左侧容器</li><li>选择Redis镜像，配置端口为6380，6381等</li><li>启动容器</li></ul></div><p><img src="/assets/image-3.B0yaDEej.png" alt="alt text" data-fancybox="gallery"></p><ul><li>修改<code>sakura-admin/src/main/resources/application.yml</code>中Redis下的host，其他默认即可</li></ul><div class="language-yml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yml</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">  # Redis配置</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">  redis</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 地址</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    host</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> 172.19.5.227 // 请改为你的服务器IP</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 端口 6380 (开发和测试使用)，6379 (生产使用)</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    port</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 6380</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 数据库索引</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    database</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 0</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 密码</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    password</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> 3edc%RFV</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 连接超时时间</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    timeout</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> 10s</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    lettuce</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      pool</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # 连接池中的最小空闲连接</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        min-idle</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 0</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # 连接池中的最大空闲连接</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        max-idle</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 8</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # 连接池的最大数据库连接数</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        max-active</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 8</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">        # #连接池最大阻塞等待时间（使用负值表示没有限制）</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">        max-wait</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> -1ms</span></span></code></pre></div><p><img src="/assets/image-4.lLgJlDbH.png" alt="alt text" data-fancybox="gallery"></p><ul><li>修改服务端口</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>默认端口为8080，不同环境需要配置不同的端口启动，注意端口不要冲突，例如：8081，8084等</p><blockquote><p>开发测试服务端口</p></blockquote><ul><li>port: 8084</li></ul><blockquote><p>生产服务端口</p></blockquote><ul><li>port: 8082</li></ul></div><ul><li>修改<code>sakura-admin/src/main/resources/application-dev.yml</code>中server下的port，其他默认即可</li></ul><div class="language-yml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yml</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;"># 服务器配置</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">server</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">  # 服务器的HTTP端口，默认为8080</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">  port</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 8084</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">  servlet</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 应用的访问路径</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    context-path</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> /</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">  tomcat</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # tomcat的URI编码</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    uri-encoding</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> UTF-8</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">    # 连接数满后的排队数，默认为100</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    accept-count</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 1000</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">    threads</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # tomcat最大线程数，默认为200</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      max</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 800</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">      # Tomcat启动初始化的线程数，默认值10</span></span>
<span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">      min-spare</span><span style="--shiki-dark:#F286C4;--shiki-light:#999999;">:</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#2F798A;"> 100</span></span></code></pre></div><p><img src="/assets/image-5.D3FxsL4k.png" alt="alt text" data-fancybox="gallery"></p><ul><li>运行<code>sakura-admin/src/main/java/com/sakura/Application.java</code>，启动项目即可</li></ul><p><img src="/assets/image-6.Dykl4LYf.png" alt="alt text" data-fancybox="gallery"></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>启动成功后，访问地址：<a href="http://localhost:8084" target="_blank" rel="noreferrer">http://localhost:8084</a></li><li>页面正常会显示【欢迎使用sakura后台管理框架，当前版本：v1.0.0，请通过前端地址访问。】</li></ul></div><h3 id="前端启动" tabindex="-1">前端启动 <a class="header-anchor" href="#前端启动" aria-label="Permalink to &quot;前端启动&quot;">​</a></h3><ul><li><p>创建本地目录，例如：<code>D:\IDEA\Sakura.Automation.Platform</code></p></li><li><p>进入项目目录，执行命令：</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#97E1F1;--shiki-light:#998418;">cd</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> D:</span><span style="--shiki-dark:#F286C4;--shiki-light:#A65E2B;">\I</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;">DEA</span><span style="--shiki-dark:#F286C4;--shiki-light:#A65E2B;">\S</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;">akura.Automation.Platform</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">git</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> clone</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> https://github.com/hagyao520/Sakura.Automation.Platform.Web.git</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">或</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">git</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> clone</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> https://gitee.com/SakuraTech/Sakura.Automation.Platform.Web.git</span></span></code></pre></div></li><li><p>启动VSCode，打开项目Sakura.Automation.Platform.Web</p></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>菜单 文件 -&gt; 打开文件夹，选择工作目录，然后点击 OK 按钮，即可成功导入。</li></ul></div><p><img src="/assets/image-7.CNMhaDWV.png" alt="alt text" data-fancybox="gallery"></p><ul><li>配置镜像源</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>npm 官方原始镜像网址是：<a href="https://registry.npmjs.org/" target="_blank" rel="noreferrer">https://registry.npmjs.org/</a></li><li>淘宝 NPM 镜像：<a href="https://registry.npmmirror.com" target="_blank" rel="noreferrer">https://registry.npmmirror.com</a></li><li>阿里云 NPM 镜像：<a href="https://npm.aliyun.com" target="_blank" rel="noreferrer">https://npm.aliyun.com</a></li><li>腾讯云 NPM 镜像：<a href="https://mirrors.cloud.tencent.com/npm/" target="_blank" rel="noreferrer">https://mirrors.cloud.tencent.com/npm/</a></li><li>华为云 NPM 镜像：<a href="https://mirrors.huaweicloud.com/repository/npm/" target="_blank" rel="noreferrer">https://mirrors.huaweicloud.com/repository/npm/</a></li><li>网易 NPM 镜像：<a href="https://mirrors.163.com/npm/" target="_blank" rel="noreferrer">https://mirrors.163.com/npm/</a></li><li>中科院大学开源镜像站：<a href="http://mirrors.ustc.edu.cn/" target="_blank" rel="noreferrer">http://mirrors.ustc.edu.cn/</a></li><li>清华大学开源镜像站：<a href="https://mirrors.tuna.tsinghua.edu.cn/" target="_blank" rel="noreferrer">https://mirrors.tuna.tsinghua.edu.cn/</a></li></ul><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;"># 切换到淘宝 NPM 镜像</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">npm</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> config</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> set</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> registry</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> https://registry.npmmirror.com</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;"># 验证是否已经切换成功</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">npm</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> config</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> get</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> registry</span></span></code></pre></div></div><ul><li><p>安装依赖</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">#推荐使用yarn</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">npm</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> install</span><span style="--shiki-dark:#BF9EEE;--shiki-light:#A65E2B;"> -g</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> yarn</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">#安装依赖</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">yarn</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> install</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">#或</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">npm</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> install</span></span></code></pre></div></li><li><p>环境配置</p></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>默认有三个对应环境的配置文件，不同环境需要配置不同的端口启动，注意端口不要冲突，例如：</p><ul><li>开发环境 <ul><li>端口：8083</li><li>前端地址：<a href="http://localhost:8083" target="_blank" rel="noreferrer">http://localhost:8083</a></li><li>接口地址：<a href="http://localhost:8084" target="_blank" rel="noreferrer">http://localhost:8084</a></li></ul></li><li>测试环境： <ul><li>端口：8083</li><li>前端地址：<a href="http://172.19.5.227:8083" target="_blank" rel="noreferrer">http://172.19.5.227:8083</a></li><li>接口地址：<a href="http://172.19.5.227:8084" target="_blank" rel="noreferrer">http://172.19.5.227:8084</a></li></ul></li><li>生产环境： <ul><li>端口：8081</li><li>前端地址：<a href="http://172.19.5.227:8081" target="_blank" rel="noreferrer">http://172.19.5.227:8081</a></li><li>接口地址：<a href="http://172.19.5.227:8082" target="_blank" rel="noreferrer">http://172.19.5.227:8082</a></li></ul></li></ul></div><ul><li>修改Sakura.Automation.Platform.Web/.env.development中的对应服务端口</li></ul><p><img src="/assets/image-8.Bmv9PVG3.png" alt="alt text" data-fancybox="gallery"></p><ul><li><p>运行项目</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">yarn</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> dev</span></span>
<span class="line"><span style="--shiki-dark:#7B7F8B;--shiki-light:#A0ADA0;">#或</span></span>
<span class="line"><span style="--shiki-dark:#62E884;--shiki-light:#59873A;">npm</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> run</span><span style="--shiki-dark:#E7EE98;--shiki-light:#B56959;"> dev</span></span></code></pre></div><p><img src="/assets/image-9.CZdSGMj0.png" alt="alt text" data-fancybox="gallery"></p></li><li><p>访问地址：<a href="http://localhost:8083" target="_blank" rel="noreferrer">http://localhost:8083</a></p></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li>运行成功后，会自动打开浏览器，并进入登录页面</li><li>默认账号：管理员</li><li>默认密码：111111</li><li>可自己注册账号使用</li></ul></div><p><img src="/assets/image-10.cjlHU8bg.png" alt="alt text" data-fancybox="gallery"></p></div></div></main><footer class="VPDocFooter" data-v-33eb8004 data-v-b67cf673><!--[--><!--[--><!--[--><!--[--><!----><!--]--><!--]--><!--]--><!--]--><div class="edit-info" data-v-b67cf673><div class="edit-link" data-v-b67cf673><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/SakuraTechy/sakura-docs/edit/dev/src/en/1.使用指南/3.本地开发/index.md" target="_blank" rel="noreferrer" data-v-b67cf673><!--[--><span class="vpi-square-pen edit-link-icon" data-v-b67cf673></span> Suggest changes to this page<!--]--></a></div><div class="last-updated" data-v-b67cf673><p class="VPLastUpdated" data-v-b67cf673 data-v-8dc6d9a3>最后更新于: <time datetime="2025-03-27T09:03:20.000Z" data-v-8dc6d9a3></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-b67cf673><span class="visually-hidden" id="doc-footer-aria-label" data-v-b67cf673>Pager</span><div class="pager" data-v-b67cf673><!----></div><div class="pager" data-v-b67cf673><a class="VPLink link pager-link next" href="/1.使用指南/1.产品简介/index.html" data-v-b67cf673><!--[--><span class="desc" data-v-b67cf673>Next page</span><span class="title" data-v-b67cf673>产品简介</span><!--]--></a></div></nav></footer><!--[--><!--[--><!--[--><div id="comment-container"></div><!--]--><!--]--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-f4468d7a data-v-856d5f9e><div class="container" data-v-856d5f9e><p class="message" data-v-856d5f9e>Released under the Apache-2.0 License.</p><p class="copyright" data-v-856d5f9e>Copyright © 2019-2025 SakuraTechy</p></div></footer><!--[--><!--]--></div></div>
    
    
  </body>
</html>